﻿using Framework.Exceptions;
using Interfaces.Validation.Repositories;
using Interfaces.Validation.Services;

namespace BusinessLogic.Services.Validation
{
    public class NewsValidationService : INewsValidationService
    {
        private readonly INewsValidationRepository _newsValidationRepository;

        public NewsValidationService(INewsValidationRepository newsValidationRepository)
        {
            _newsValidationRepository = newsValidationRepository;
        }

        public bool IsFeedExsists(string url)
        {
            return ExceptionHandlingManager.Process(() => _newsValidationRepository.IsFeedExists(url), PolicyNames.DALPolicy);
        }
    }
}
